package com.baizhi.service.impl;

import com.baizhi.dao.StudentDao;
import com.baizhi.Student;
import com.baizhi.service.StudentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentDao st;
    @Override
    public PageInfo<Student> selectByPage(int pageIndex, int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<Student> students = st.selectList(null);
        return new PageInfo<>(students);
    }
}
